package com.example.spindrift.service;

import com.example.spindrift.dao.ShareMapper;
import com.example.spindrift.models.SysSong;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShareService {
    @Autowired
    ShareMapper shareMapper;

    /**
     * 获取指定用户分享的音乐信息
     * @param userId 用户ID
     * @return
     */
    public List<SysSong> getShareSongByUser(Integer userId) {
        return shareMapper.getShareSongByUser(userId);
    }

    /**
     * 删除一条或多条分享信息
     * @param userId 用户ID
     * @param songIds 歌曲ID
     * @return
     */
    public Integer deleteShareSongByIds(Integer userId, String songIds) {
        return shareMapper.deleteShareSongByIds(userId,songIds);
    }
    public List<SysSong> searchShare(Integer userId,String keyword){
        return shareMapper.searchShare(userId,keyword);
    }
}
